// Learn TypeScript:
//  - https://docs.cocos.com/creator/manual/en/scripting/typescript.html
// Learn Attribute:
//  - https://docs.cocos.com/creator/manual/en/scripting/reference/attributes.html
// Learn life-cycle callbacks:

import ScreenAdaptMgr from "../utils/ScreenAdaptMgr";

//  - https://docs.cocos.com/creator/manual/en/scripting/life-cycle-callbacks.html
const { ccclass } = cc._decorator;

@ccclass
export default class loading extends cc.Component {
    // LIFE-CYCLE CALLBACKS:
    // onLoad () {}
    set progress(newNum: number) {
        this.node.getComponent(cc.ProgressBar).progress = newNum
        this.node.getChildByName('item').x = this.node.getComponent(cc.ProgressBar).progress * (this.node.getChildByName('end').x + 10)
    }
    // update (dt) {}
    protected start(): void {
        ScreenAdaptMgr.initAdapt()
    }
}
